|
In computer science, an induction variable is a variable that gets increased or decreased by a fixed amount on every iteration of a loop, or is a linear function of another induction variable. For example, in the following loop, i and j are induction variables:for (i=0; i < 10; ++i) ==Application to strength reduction== A common compiler optimization is to recognize the existence of induction variables and replace them with simpler computations; for example, the code above could be rewritten by the compiler as follows, on the assumption that the addition of a constant will be cheaper than a multiplication. j = -17; for (i = 0; i < 10; ++i) This optimization is a special case of strength reduction. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「induction variable」の詳細全文を読む スポンサード リンク
|